package com.elitesland.system.service;

import com.elitesland.system.entity.SysRolePermissionDO;
import com.elitesland.system.vo.SysPermissionVO;
import com.elitesland.system.vo.SysRoleVO;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * <pre>
 *     角色权限关联服务
 * </pre>
 * @author mir
 * @date 2020-09-28
 */
public interface SysRolePermissionService {

    Set<SysPermissionVO> listPermissionsByRoleId(Long roleId);

    Set<SysPermissionVO> listMenusByRoleId(Long roleId);

    Set<SysPermissionVO> listActionsByRoleId(Long roleId);

    Map<Long, Set<SysPermissionVO>> listPermissionsByRoleIds(List<Long> roleIds);

    Set<SysRoleVO> listRolesByPermissionId(Long permissionId);

    Map<Long, Set<SysRoleVO>> listRolesByPermissionIds(List<Long> permissionIds);

    Set<SysPermissionVO> listActionsByMenuIdOfRole(Long roleId, Long menuId);

    void saveAll(List<SysRolePermissionDO> rps);

    void saveAllByMenu(Long roleId, Long menuId, Set<Long> permissionIds);

    void removePermissionsByRoleIds(List<Long> roleIds);

    void removeRolesByPermissionIds(List<Long> permissionIds);
}
